package com.googlecode.dgwt.client.dojox.data.model.base;

import com.googlecode.dgwt.client.dojo.data.model.TableColumnBase;

/**
 * @author      Wellington Tadeu dos Santos
 * @since       DGWT v0.01
 */
public abstract class NamedTableColumnBase<Item, Type> extends TableColumnBase<Item, Type> implements NamedTableColumn<Item, Type> {

    private String name;    

    public NamedTableColumnBase() {
        super();
        name = "";
    }

    public NamedTableColumnBase(String title) {
        super(title);
        name = "";
    }

    public NamedTableColumnBase(String name, String title) {
        super(title);
        setName(name);
    }

    
    public void setName(String name) {
        if (name == null) {
            name = "";
        }
        if (!name.equals(this.name)) {
            this.name = name;
            onColumnChanged();
        }
    }

    
    @Override
    public String getName() {
        return name;
    }

}
